package com.android.photoalbum.utils;


import com.android.photoalbum.bean.AlbumFolderBean;

import java.util.ArrayList;

public class FileUtils {

    public static String getParentFolderName(String path) {
        String sp[] = path.split("/");
        return sp[sp.length - 2];
    }

    public static int isExistAlbumDir(ArrayList<AlbumFolderBean> albumFolderBeen, String dirName) {
        for (int i = 0; i < albumFolderBeen.size(); i++) {
            AlbumFolderBean albumFolderBean = albumFolderBeen.get(i);
            if (albumFolderBean.name.equals(dirName)) {
                return i;
            }
        }
        return -1;
    }

}
